package com.company.restaurant.dto;

/**
 * Description of class.
 * Created 5/16/14 1:13 PM
 *
 * @author andrey.rodin@playtech.com
 */

public enum Protocol {
    JSON(0),
    BINARY_JAVA_SERIALIZABLE(1),
    BINARY_JSON_SERIALIZABLE(2)
    ;

    private int id;

    Protocol(int id) {
        this.id = id;
    }

    public int getId() {
        return id;
    }

    public static Protocol getById(int id) {
        for (Protocol protocol : values()) {
            if (protocol.getId() == id) {
                return protocol;
            }
        }
        return null;
    }
}
